#include <iostream>
#include <bitset>

void print_first_single(char *str)
{
    std::bitset<2 * 256> bs(0);
    char *p = str;

    while (*p++ != '\0') {
        int i = *p;

        if (!bs.test(i * 2) && !bs.test(i * 2 + 1)) {
            bs.set(i * 2);
        } else if (bs.test(i * 2) && !bs.test(i * 2 + 1)) {
            bs.set(i * 2 + 1);
        }
    }

    p = str;

    while (*p++ != '\0') {
        int i = *p;

        if (bs.test(i * 2) && !bs.test(i * 2 + 1)) {
            std::cout << "The first single is " << *p << std::endl;
            return ;
        }
    }

    std::cout << "Not exist" << std::endl;
}

int main(int argc, const char *argv[])
{
    char str[] = "I I I I jjs lajdl alsdjheljlyhc am a student.";
    std::cout << str << std::endl;
    print_first_single(str);
    return 0;
}
